package com.icss.vo;

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import com.icss.common.vo.BasePojo;

/**
 * 商品Pojo
 * 
 * @author 陈岩
 */
public class MakeupProduct extends BasePojo<MakeupProduct>
{
	private int id;
	private int categoryId ; 
	private String name;
	private String brief;
	private double price;
	private int saleNum;
	private String pic;
	private String content;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date enableTime;

	/*--字符串表示--*/
	private String statusStr;
	
	/*--关联关系表示--*/
	private MakeupCategory category ; 
	
	/* 存储所有状态的容器 */
	private Map<String, String> enumsMap = new TreeMap<String, String>();

	/**
	 * 获取此表相关的所有枚举值
	 * 
	 * @return 键为枚举的变量名+枚举的值; 值为枚举的名字 如:key:STATUS_ENABLE-1,值:启用
	 */
	public Map<String, String> getEnumsMap()
	{
		// 根据状态值获取字符串描述
		MakeupProductEnum[] enums = MakeupProductEnum.values();
		for (int i = 0; i < enums.length; i++)
		{
			MakeupProductEnum enumTemp = enums[i];
			String key = enumTemp.toString();
			enumsMap.put(key + "-" + enumTemp.getStatus() + "", enumTemp.getName());
		}
		return enumsMap;
	}
	
	/**
	 * 获取此表相关的所有枚举值
	 * 
	 * @return 键为枚举的变量名+枚举的值; 值为枚举的名字 如:key:STATUS_ENABLE-1,值:启用
	 */
	public Map<String, String> getEnums()
	{
		// 根据状态值获取字符串描述
		MakeupProductEnum[] enums = MakeupProductEnum.values();
		for (int i = 0; i < enums.length; i++)
		{
			MakeupProductEnum enumTemp = enums[i];
			enumsMap.put(enumTemp.toString(), enumTemp.getStatus() + "");
		}
		return enumsMap;
	}

	/**
	 * 获取状态的字符串描述
	 * 
	 * @return 此状态对应的字符串描述
	 */
	public String getStatusStr()
	{
		// 根据状态值获取字符串描述
		MakeupProductEnum[] enums = MakeupProductEnum.values();
		for (int i = 0; i < enums.length; i++)
		{
			MakeupProductEnum enumTemp = enums[i];
			if (enumTemp.toString().startsWith("STATUS_"))
			{
				// 表示是状态的标识
				if (enumTemp.getStatus() == this.getStatus())
				{
					this.statusStr = enumTemp.getName();
					break;
				}
			}
		}
		return statusStr;
	}

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getBrief()
	{
		return brief;
	}

	public void setBrief(String brief)
	{
		this.brief = brief;
	}

	public double getPrice()
	{
		return price;
	}

	public void setPrice(double price)
	{
		this.price = price;
	}

	public int getSaleNum()
	{
		return saleNum;
	}

	public void setSaleNum(int saleNum)
	{
		this.saleNum = saleNum;
	}

	public String getContent()
	{
		return content;
	}

	public void setContent(String content)
	{
		this.content = content;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public int getCategoryId()
	{
		return categoryId;
	}

	public void setCategoryId(int categoryId)
	{
		this.categoryId = categoryId;
	}

	public String getPic()
	{
		return pic;
	}

	public void setPic(String pic)
	{
		this.pic = pic;
	}

	public Date getEnableTime()
	{
		return enableTime;
	}

	public void setEnableTime(Date enableTime)
	{
		this.enableTime = enableTime;
	}

	public MakeupCategory getCategory()
	{
		return category;
	}

	public void setCategory(MakeupCategory category)
	{
		this.category = category;
	}
}
